Skip to content

flow: log_cmd the unlogged synth and load steps for timing#4292

Closed
oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:synth-load-log-cmd-timing
Closed

flow: log_cmd the unlogged synth and load steps for timing#4292
oharboe wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:synth-load-log-cmd-timing

Conversation

@oharboe

@oharboe oharboe commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

The synth_odb step runs load_design and the PRE/POST SYNTH step-tcl hooks, and load.tcl runs read_verilog, without wrapping them in log_cmd. Their wall time is therefore not attributed in the per-command timing log, leaving a gap when accounting for where the synth step spends its time.

link_design, read_sdc, eliminate_dead_logic, write_db and write_sdc already log themselves; this wraps the remaining ops to match. No behavior change.

The synth_odb step runs load_design and the PRE/POST SYNTH step-tcl
hooks, and load.tcl runs read_verilog, without wrapping them in log_cmd.
Their wall time is therefore not attributed in the per-command timing
log, leaving a gap when accounting for where the synth step spends its
time. link_design, read_sdc, eliminate_dead_logic, write_db and
write_sdc already log themselves; wrap the remaining ops to match. No
behaviour change.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request wraps several commands in log_cmd within flow/scripts/load.tcl and flow/scripts/synth_odb.tcl to improve logging. The reviewer recommends against wrapping load_design and source_step_tcl in log_cmd because doing so introduces redundant nested logging and noise. Instead, the reviewer suggests wrapping the remaining unlogged internal commands, such as read_lef inside load_design, directly.

Comment thread flow/scripts/synth_odb.tcl Outdated
Comment on lines +4 to +5
log_cmd load_design 1_2_yosys.v 1_2_yosys.sdc
log_cmd source_step_tcl PRE SYNTH

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Wrapping load_design and source_step_tcl in log_cmd introduces redundant nested logging and unnecessary noise:

  1. source_step_tcl: This procedure internally calls source_env_var_if_exists, which already wraps the source command in log_cmd if the hook is defined. Wrapping it here causes redundant nested logs when hooks are defined, and prints empty/noisy log entries when they are not.
  2. load_design: Almost all internal commands of load_design (like read_verilog, link_design, read_sdc, etc.) are already wrapped in log_cmd. Wrapping the entire procedure results in nested logs.

Instead of wrapping load_design here, we should wrap the remaining unlogged commands (like read_lef) inside load_design itself in flow/scripts/load.tcl.

load_design 1_2_yosys.v 1_2_yosys.sdc
source_step_tcl PRE SYNTH

Comment thread flow/scripts/synth_odb.tcl Outdated
report_design_area_metrics

source_step_tcl POST SYNTH
log_cmd source_step_tcl POST SYNTH

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

As mentioned, source_step_tcl already logs the actual source command internally if the hook is defined. Wrapping it in log_cmd here is redundant and adds noise to the logs when the hook is not defined.

source_step_tcl POST SYNTH

Comment thread flow/scripts/load.tcl
}
}
read_verilog $::env(RESULTS_DIR)/$design_file
log_cmd read_verilog $::env(RESULTS_DIR)/$design_file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While wrapping read_verilog in log_cmd is a great improvement, the read_lef commands in load_design (lines 19, 20, and 23) are still not logged. Sourcing LEF files can take a significant amount of time, so wrapping them in log_cmd inside load_design would provide complete visibility without needing to wrap the entire load_design procedure in synth_odb.tcl (which causes nested logging).

@oharboe oharboe closed this Jun 14, 2026
Per review, wrapping load_design and source_step_tcl in log_cmd
double-logs: source_step_tcl already log_cmd's its source via
source_env_var_if_exists, and load_design's other internals (read_verilog,
link_design, read_sdc) are already wrapped. The only unlogged ops are the
read_lef calls in load_design. Wrap those directly and revert the
synth_odb.tcl wraps; the net change is read_lef/read_verilog logging only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe oharboe reopened this Jun 14, 2026
@oharboe

oharboe commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator Author

Reworked per review: source_step_tcl already log_cmds its source (via source_env_var_if_exists), and load_design's other internals are already wrapped — so wrapping the whole procs double-logged. The follow-up commit instead wraps the unlogged read_lef calls inside load_design and reverts the synth_odb.tcl wraps; net change is read_lef/read_verilog logging only.

@oharboe oharboe closed this Jun 14, 2026
@oharboe

oharboe commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

Not pursuing this one — closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant